#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFile>
#include <QDir>
#include <QFileDialog>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    connect(&wk, SIGNAL(msgout(QString)),
            this, SLOT(showMsg(QString)));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pbfolder_clicked()
{
    QString dir;

    dir = QFileDialog::getExistingDirectory(this, "选择照片目录", "./");
    if (!dir.isEmpty())
    {
       ui->lefolder->setText(dir);
    }
}

void MainWindow::on_pushButton_clicked()
{
    emit wk.rename(ui->lefolder->text());
}

void MainWindow::showMsg(QString m)
{
    ui->lbcurfile->setText(m);
}
